package ups.MapParse;

import java.util.Comparator;
public class PointComparator implements Comparator<Point> {
	public int compare( Point p1, Point p2 ) {
		if( p1.y > p2.y ) {
			return 1; // p1 is greater
		} else if ( p1.y < p2.y ) {
			return -1; // p2 is greater
		} else { // y == y
			if( p1.x > p2.x ) {
				return 1; //p1 is greater
			} else if( p1.x < p2.x) {
				return -1;
			} else {
				return 0;
			}
		}
		
	}
}
